<template>
	<iframe
		height="100%"
		width="100%"
		:src="url + '/?token=' + Session.get('token') + '&screenId=' + screenId + '&userId=' + userId"
		frameborder="0"
		id="screen-iframe"
		scrolling="no"
	/>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useUserInfosState } from '@/stores/userInfos';
import { Session } from '@/utils/storage';

const route = useRoute();
const userInfos = useUserInfosState();
const userId = computed(() => userInfos.userInfos.userId);
const preUrl = ref(import.meta.env.VITE_SCREEN_URL);

const screenId: any = ref('');
const url = `${preUrl.value}/#/chart/preview`;
// const url = `http://l.l-l.cn/visual/#/chart/home`;

onMounted(() => {
	screenId.value = route.query.id;
});
</script>
